
<template>
<!--  分佣规则-->
  <div v-if="props.scope.typeCode === 'commissionRate'">{{getCommissionRateContent(props.scope.content)}}</div>
<!--  每日提现上限-->
  <div v-if="props.scope.typeCode === 'withdrawalLimit'">{{getWithdrawalLimitContent(props.scope.content)}}</div>
<!--  收款账户-->
  <div v-if="props.scope.typeCode === 'receivingAccount'">{{getReceivingAccountContent(props.scope.content)}}</div>

</template>
<script setup>
import {onMounted, ref, watch} from 'vue'
import {quartileFormat} from '@/utils'
const props = defineProps({ scope: {default: ''}, param: {default: ''}})

const getCommissionRateContent = (item) => {
  let effectiveRule = item.effective
  let waitingRule = item.waiting
  let effectiveThisLevelRate = effectiveRule? effectiveRule.thisLevelRate : 0
  let effectiveUpOneLevelRate = effectiveRule? effectiveRule.upOneLevelRate : 0
  let effectiveEffectiveTime = effectiveRule? effectiveRule.effectiveTime : '无'
  let waitingThisLevelRate = waitingRule? waitingRule.thisLevelRate : 0
  let waitingUpOneLevelRate = waitingRule? waitingRule.upOneLevelRate : 0
  let waitingEffectiveTime = waitingRule? waitingRule.effectiveTime : '无'
  let effectiveRuleContent = '本级' + effectiveThisLevelRate + '%，下级' + effectiveUpOneLevelRate + '%；'
  let waitingRuleContent = '本级' + waitingThisLevelRate + '%，下级' + waitingUpOneLevelRate + '%(生效时间：'
                            + waitingEffectiveTime + ')'
  return '当前生效规则：' + effectiveRuleContent + '未来生效规则：' + (waitingRule? waitingRuleContent : '暂无')
}
const getWithdrawalLimitContent = (item) => {
  let limitPrice = item.limitPrice + '元'
  return quartileFormat(limitPrice) || 0
}
const getReceivingAccountContent = (item) => {
  let receivingAccount = '账户名称：' + item.name + '；开户银行：' + item.bankName + '；收款账号：' + item.account
  return receivingAccount
}
onMounted(() => {
})
</script>

<style scoped>
</style>
